package game.map.mapEvents;

import game.map.Static;

public class ChangeMapEvent extends MapEvent {
	
	private String mapName;
	private int initX, initY;
	
	public ChangeMapEvent(String eventId, int x, int y, String mapName,
			int initX, int initY) {
		super(eventId, x, y, x, y);
		this.initX = initX;
		this.initY = initY;
		this.mapName = mapName;
	}

	public ChangeMapEvent(String[] encoded) {
		super(encoded);
		this.mapName = encoded[6];
		this.initX = Integer.parseInt(encoded[7]);
		this.initY = Integer.parseInt(encoded[8]);
	}

	public String getMapName() {
		return mapName;
	}
	public void setMapName(String mapName) {
		this.mapName = mapName;
	}
	
	@Override
	public String encode(String sep) {
		return super.encode(sep) + sep + mapName + sep + initX + sep + initY;
	}

	public int getInitX() {
		return initX;
	}
	public int getInitY() {
		return initY;
	}

	@Override
	protected int getColor() {
		return Static.GRAY;
	}

}
